/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.tnmk.worktime.service.export.xls.format;

import jxl.write.DateFormat;
import jxl.write.NumberFormat;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;

/**
 *
 * @author Administrator
 */
public class XlsFormatFactory {

  public static WritableCellFormat newBoldFormat() {
    WritableFont cellFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
    WritableCellFormat f = new WritableCellFormat(cellFont);
    return f;
  }
  public static WritableCellFormat newDecimalFormat() {
    NumberFormat decimalNo = new NumberFormat("#,##0.00");
    WritableCellFormat f = new WritableCellFormat(decimalNo);
    return f;
  }
  public static WritableCellFormat newIntegerFormat() {
    NumberFormat decimalNo = new NumberFormat("#,##0");
    WritableCellFormat f = new WritableCellFormat(decimalNo);
    return f;
  }
  public static WritableCellFormat newDateTimeFormat() {
    DateFormat fm = new DateFormat("yyyy-MM-dd hh:mm:ss a");
    WritableCellFormat f = new WritableCellFormat(fm);
    return f;
  }
  
}
